﻿// JavaScript Document
function SetCookie(name,value)
{
	if(value !='' && value!= null){
    var Days = 3; //此 cookie 将被保存 30 天
    var exp  = new Date();    //new Date("December 31, 9998");
    exp.setTime(exp.getTime() + Days*24*60*60*1000);
    document.cookie = name + "="+ escape (value) + ";expires=" + exp.toGMTString();
	}
}
function getCookie(name)//取cookies函数        
{
    var arr = document.cookie.match(new RegExp("(^| )"+name+"=([^;]*)(;|$)"));
     if(arr != null) return unescape(arr[2]); return null;

}
function delCookie(name)//删除cookie
{
    var exp = new Date();
    exp.setTime(exp.getTime() - 1);
    var cval=getCookie(name);
    if(cval!=null) document.cookie= name + "="+cval+";expires="+exp.toGMTString();
}
function read_cookie(){

 var c_email = getCookie('c_email');
 var c_message = getCookie('c_message');
 var c_contacter = getCookie('c_contacter');
 var c_company = getCookie('c_company');
 var c_telephone = getCookie('c_telephone');
 var c_fax = getCookie('c_fax');
 if(c_email != null){
	document.getElementById('email').value=c_email;
 }

 if(c_message != null ){
     document.getElementById('message').value= c_message;
 }
 if(c_contacter != null ){
     document.getElementById('contacter').value= c_contacter;
 }
 if(c_fax != null ){
     document.getElementById('fax').value= c_fax;
 }
 if(c_telephone != null ){
     document.getElementById('telephone').value= c_telephone;
 }
 if(c_company != null ){
     document.getElementById('company').value= c_company;
 }
}

function reShowFloatWindow()
{
var getlocation=window.location.href;
getlocation=getlocation.toString();
getlocation=getlocation.split('&etwurl=');
var url=getlocation[1];
url=url.split('/');
var getlength=url.length;
if(window.ActiveXObject && getlength>3){
window.setInterval(showmouseevent,4000);
function showmouseevent()
{
if(!document.hasFocus())
{
window.focus();
}
}}
}

function borderstyle(ob){
	ob.style.cssText="border:2px solid #80FF00;"
}

function clearemail(){
	var email=document.getElementById("email");
    if((email.value).indexOf("@")<1){
	email.value="";
	email.style.cssText="font-weight:bold; color:#990000;";
}}
